<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        @keyframes anmiatewh {/*定义动画，名字为anmiatewh*/
            from{/*0%即开始状态*/
                background-color: red;
                width: 200px;
                height: 100px;
            }
            50%{
                background-color: green;
            }
            to{/*100%即最后状态*/
                background-color: yellow;
                width: 400px;
                height: 200px;
            }
        }
        div{
            animation-name: anmiatewh;/*指定动画名字*/
            animation-duration: 2s;/*动画持续时长*/
            /*animation-delay: 3s;动画延迟*/
            animation-iteration-count: 1;/*动画执行次数*/
            animation-direction: alternate ;/*动画方向，来回*/
            animation-fill-mode:forwards;/*执行完动画的元素状态，保留动画最后状态*/
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>